import React, {useContext} from 'react'
import { TextContext } from '../utils/Context'

export default function Chidlren() {
    const { title, state, dispatch } = useContext(TextContext)
    return (
        <div>
            <h1>{title}</h1>
            <h2>{state.storeTitle}</h2>
            <button onClick={() => dispatch({type: 'changeStoretitle', title: '嘿嘿嘿'})}>在children中更改app里面的store</button>
        </div>
    )
}
